/**
 * 
 */
package niuke.wangyi;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 把数字重新排序后组成最大的数字 利用string的自定义类似字典序
 * 
 * @author zhongfang
 *
 */
public class test3 {

	static class MyClass implements Comparable<MyClass> {
		String string;

		public MyClass(String string) {
			this.string = string;
		}

		@Override
		public int compareTo(MyClass o) {// 逆序
			String tmp1 = this.string + o.string;
			String tmp2 = o.string + this.string;
			return -tmp1.compareTo(tmp2);
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String string = scanner.nextLine();
		scanner.close();
		String[] strings = string.split(" ");
		MyClass[] myClasses = new MyClass[strings.length];
		for (int i = 0; i < strings.length; i++) {
			myClasses[i] = new MyClass(strings[i]);
		}
		Arrays.sort(myClasses);
		StringBuilder sBuilder = new StringBuilder();
		for (MyClass myClass : myClasses) {
			sBuilder.append(myClass.string);
		}
		System.out.println(sBuilder);
	}

}
